/**
 * User: Farside
 * Date: Apr 5, 2009
 * To change this template use File | Settings | File Templates.
 */

public class SecurityFilters {

  def filters = {
    security(controller: '*', action: '*') {
      before = {
        if (!session.volunteer
                && !(controllerName.equals('volunteer')
                && ((actionName.equals('login')
                || actionName.equals('handleLogin')
                || actionName.equals('create')
                || actionName.equals('save'))))
        ) {
          redirect(controller: 'volunteer', action: 'login')
          return false
        }
      }
    }
  }
}